<%-- 
    Document   : admin
    Created on : Apr 23, 2013, 1:35:12 AM
    Author     : TNT
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="common.jsp" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link rel="shortcut icon" href="image/icon.png">
    </head>
<body bgcolor="#CCFFFF">
<script language="JavaScript">
function checkinput(){
	if(document.form1.username.value==""){
		alert("Xin vui long nhap username");
		document.form1.username.focus();
		return false;
	}
	if(document.form1.password.value=="" ){
		alert("Xin vui long nhap password");
		document.form1.password.focus();
		return false;
	}
	return true;
}
</script>
<%
	String userid=getVal((String)session.getValue("userid"),"");
	if(!(userid.equals("")|| userid.equals("0") || userid.equals("-1")|| userid.equals("-2"))) response.sendRedirect("index.jsp");
	String err="Xin vui lòng nhập password";
	if(userid.equals("0")){err="<font color=\"#FF0000\">Sai password,Xin vui lòng nhập password</font>";}
	if(userid.equals("-1")){err="<font color=\"#FF0000\">Sai username,Xin vui lòng nhập username</font>";}
	if(userid.equals("-2")){err="<font color=\"#FF0000\">Loi he thong, Xin vui lòng thử lại</font>";}
%>
<TABLE align=center>
  <tr>
      <td colspan="5"><div align="center"><a href ="index.jsp"> <img src ="image/banner.jpg" width ="1024px" height="150" ></a></div></td>
  </tr>
</TABLE>
<form action=loginauthentication.jsp name=form1 method=post onSubmit="return checkinput();">
	<table align=center>
		<tr>
		<td colspan="2" height="19">
		<h4><b><font color="#FF0000">
		<font color="#0000CC">Quản trị</font>
		</font></b></h4><hr>
		</td>
		</tr><tr>
		<td colspan=2 height="19">
		<div align="left"><%=err%></div>
		</td>
		</tr>
		<tr>
		<td height="19">
		<div align="left">Username</div>
		</td>
		<td height="19">
		<div align="left">
		<input type="text" name="username"
		size="30" maxlength="50" class=textbox>
		</div>
		</td>
		</tr>
		<tr>
		<td height="31">
		<div align="left">Password</div>
		</td>
		<td height="31">
		<div align="left">
		<input type="password" name="password"
		size="30" maxlength="50" class=textbox>
		</div>
		</td>
		</tr>
		<tr>
		<td >&nbsp;</td>
		<td>&nbsp;</td>
		</tr><tr>
		<td ></td>
		<td ><input type=submit value="Đăng nhập">
		&nbsp; <input type=reset value="Hủy"></td>
		</tr>
	</table>
</form>
</body>
</html>
